package com.it.data.network

import LoginVo
import com.it.common.bean.ResultBean
import com.it.data.manager.HttpManager
import com.it.data.network.req.LoginDto
import com.it.data.network.rsp.GQStationVo
import com.it.data.network.rsp.GQYWXXVo
import com.it.data.network.rsp.MenuVo
import com.it.data.network.rsp.NodeVo
import com.it.data.network.rsp.OpDictDataVo
import com.it.data.network.rsp.PageVo
import com.it.data.network.rsp.QuaTypeVo
import com.it.data.network.rsp.SttpVo
import com.it.data.network.rsp.WtGQVo
import retrofit2.http.Body
import retrofit2.http.GET
import retrofit2.http.POST
import retrofit2.http.Path
import retrofit2.http.Query
import retrofit2.http.QueryMap
import retrofit2.http.Url

/**
 *  @Description：http接口
 *  @author：weishixiong
 *  @date：2023/3/27 16:07
 *
 */
interface Api {
    companion object {
        fun apiClient(): Api {
            return HttpManager.create(Api::class.java);
        }

        const val GET_GQSTATIONLIST = "biz/op/OpStbprpExt/getGQStationList"
        const val GET_WTGQ = "biz/op/OpQuestionInfo/getWtGQ"
    }

    /**
     * 登录
     * @param dto LoginDto
     * @return ResultBean<LoginVo>
     */
    @POST("sys/login")
    suspend fun login(@Body dto: LoginDto): ResultBean<LoginVo>


    @GET("biz/op/OpDictData/list")
    suspend fun opDictDataList(@QueryMap map: Map<String, String>): ResultBean<PageVo<List<OpDictDataVo>>>

    /**
     * 测站列表
     * @param url String
     * @return ResultBean<PageVo<List<GQStationVo>>>
     */
    @GET
    suspend fun getGQStationList(
        @Url url: String,
        @Query("addvcd") addvcd: String?,
        @Query("sttp") sttp: String?,
        @Query("projecttype") projecttype: String?,
        @Query("quedeal") quedeal: String?,
        @Query("stnm") stnm: String?,
    ): ResultBean<PageVo<List<GQStationVo>>>


    @GET("sys/menus/findMenuListByUserid")
    suspend fun findMenuListByUserid(@Query("userId") userId: String): ResultBean<List<MenuVo>>


    @GET("biz/rw/addvcd/getNodeByAd/{depId}")
    suspend fun getNodeByAd(@Path("depId") depId: String): ResultBean<List<NodeVo>>


    @GET("biz/rw/dict/getSttp")
    suspend fun getSttp(): ResultBean<List<SttpVo>>

    /**
     * 测站详情
     * @param STCD String
     * @return ResultBean<GQYWXXVo>
     */
    @GET("biz/op/OpStbprpExt/getGQYWXX/{STCD}")//00001118
    suspend fun getGQYWXX(@Path("STCD") STCD: String): ResultBean<GQYWXXVo>

    /**
     * 运维记录列表
     * @param url String
     * @param trcd String?
     * @param stcd String?
     * @param queType String?
     * @param queDeal String?
     * @param type Int? 1 运维问题 2 运维巡检
     * @return ResultBean<PageVo<List<WtGQVo>>>
     */
    @GET
    suspend fun getWtGQ(
        @Url url: String,
        @Query("trcd") trcd: String?,
        @Query("stcd") stcd: String?,
        @Query("queType") queType: String?,
        @Query("queDeal") queDeal: String?,
        @Query("type") type: Int?,
    ): ResultBean<PageVo<List<WtGQVo>>>


    @GET("biz/op/OpDictData/getQuaType")//
    suspend fun getQuaType(@Query("sttp") sttp: String?): ResultBean<List<QuaTypeVo>>


}